package cn.wolfcode.shop.cloud.service.impl;

import cn.wolfcode.shop.cloud.domain.Good;
import cn.wolfcode.shop.cloud.mapper.GoodsMapper;
import cn.wolfcode.shop.cloud.service.IGoodsService;
import com.netflix.discovery.converters.Auto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;


@Service
public class GoodsServiceImpl implements IGoodsService {

    @Autowired
    GoodsMapper goodsMapper;

    @Override
    public List<Good> queryGoods(Set<Long> ids) {
        if(ids == null && ids.size()==0){
            return Collections.emptyList();
        }

        List<Long> list = new ArrayList<>(ids);
        return goodsMapper.queryByIds(list);
    }
}
